-
Notifications
You must be signed in to change notification settings - Fork 72
feat: Add horizontal scrolling support to GridElement (#8046) #8047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Implements scrollToColumn method to enable horizontal scrolling in Grid, particularly useful when columnRendering is set to lazy. This addresses the issue where cells return null when columns are out of view. New features: - scrollToColumn(GridColumnElement) - scrolls to specific column - scrollToColumn(int columnIndex) - scrolls to column by index - isColumnInView(GridColumnElement) - checks if column is visible - Automatic column scrolling in getCell() method This enhancement allows reliable testing of grids with many columns and lazy column rendering, fixing the issue where it was impossible to distinguish between genuinely null cells and cells not rendered due to being out of view. Fixes #8046 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Fixed compilation error by using ColumnRendering.LAZY instead of the non-existent Grid.ColumnRenderingMode.LAZY
The scrollToColumn method was using a non-existent grid.$.table.scrollToColumn(index) API. Fixed to properly manipulate table.scrollLeft to scroll columns into view based on their position relative to the table viewport. This fix ensures horizontal scrolling works correctly with lazy column rendering, allowing cells to be accessed reliably even when columns are initially out of view. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
column.__generatedTbId = grid.__generatedTbId++; | ||
} | ||
}); | ||
return grid._getColumns().length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return grid._getColumns().length; |
This new line seems to serve no purpose.
* Gets the grid cell for the given row and column. | ||
* <p> | ||
* Automatically scrolls the given row into view | ||
* Automatically scrolls the given row and column into view |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This JavaDoc update should also be applied to the JavaDoc of the other overload.
* the column to check | ||
* @return {@code true} if the column is visible, {@code false} otherwise | ||
*/ | ||
public boolean isColumnInView(GridColumnElement column) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can keep this private for now, similar to how it is with isRowInView
.
@@ -0,0 +1,72 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests seem to be testing whether the GridElement API is working rather than the Grid itself. I think we can remove the page and the test class.
Implements scrollToColumn method to enable horizontal scrolling in Grid, particularly useful when columnRendering is set to lazy. This addresses the issue where cells return null when columns are out of view.
New features:
This enhancement allows reliable testing of grids with many columns and lazy column rendering, fixing the issue where it was impossible to distinguish between genuinely null cells and cells not rendered due to being out of view.
Fixes #8046